public class OverideCasenewuttonController {

    public String Usertype{get;set;}
    public PageReference editpage;
    public String def_account_id;
    public String standardurl{get;set;}
    public OverideCasenewuttonController(ApexPages.StandardController controller) {
     Usertype= UserInfo.getUserType();
     def_account_id=ApexPages.currentPage().getParameters().get('def_account_id');
    }


    public void redirecttoeditpage()
    {
    
        
        
        if(Usertype=='Standard'&& def_account_id!=null && def_account_id!='')
            {
                standardurl='/500/e?retURL=%2F500%2Fo&nooverride=0&def_account_id='+def_account_id;
                //editpage=new PageReference('/500/e?retURL=%2F500%2Fo&nooverride=1&def_account_id='+def_account_id);
                //editpage.setredirect(true);
            }
            else if(Usertype=='Standard')
            {
                standardurl='/500/e?retURL=%2F500%2Fo&nooverride=0';
                //editpage=new PageReference('/500/e?retURL=%2F500%2Fo&nooverride=1');
                //editpage.setredirect(true);
            }
       
    }
}